1. Field of the Invention
The present invention relates generally to methods and circuits for computing and, more particularly, to methods and circuits for computing the product of two elements in a finite field or the inverse of an element in a finite field.
2. Description of the Related Art
Multiplication over large finite fields, also known as Galois fields, is used in the implementation of certain cryptographic protocols based on a theory of elliptic curves over Galois fields. These cryptographic protocols are highly computationally intensive and therefore consume a significant level of computational resources in order to perform Galois field arithmetic. Consequently, any reduction in the number of operations required for Galois field arithmetic will have a significant impact on the overall consumption of computational resources.
Generally speaking, a field is a number system with addition, subtraction, multiplication and division. The operations on the elements of the field should be associative, distributive and commutative. Therefore, there should be an element 0, where 0+x=x, and an element 1, where 1*x=x. In addition, for every x, there is a (-x), where x+(-x)=0. Further, for every value of x that is not 0, there is an inverse (1/x) where x*(1/x)=1.
Some well-known examples of fields are the real numbers, the rational numbers and the complex numbers. Each of these sets have an infinite number of elements and are therefore infinite fields.
Finite fields have a finite number of elements. As an example, when p is a prime number, a finite field GF(p) is a field with p elements. The elements of the field GF(p) may be taken to be 0, 1, . . . , p-1. Elements of the field may be added, subtracted and multiplied, but the resulting number is reduced modulo the value of p (mod p) at the end of the computation. See Chapter 4 of MacWilliams and Sloane, The Theory of Error-Correcting Codes, North Holland, 1977.
The smallest of all fields is the finite field GF(2), which is a finite field having two elements: 0 and 1. The elements may be added, subtracted, multiplied and divided. However, 1+1=0, because the modulo equivalent of the result of the addition, 2, is 0, i.e. 1+1=2 mod 2=0. Similarly, 0-1=1, because the result of the subtraction, (-1), is reduced modulo the value of p, which is 2, the result of the subtraction is a modulo 1, i.e. 0-1=(-1) mod 2=1.
Another type of finite field is GF(2.sup.n), a field with 2.sup.n elements. GF(2.sup.n) is an n-th degree extension of GF(2).
The finite field GF(2.sup.n)is a vector space of dimension n over GF(2). As such, it can be represented using any basis of n linearly independent elements of GF(2.sup.n) over the binary field GF(2). Therefore, elements of GF(2.sup.n) are represented by binary vectors of length n. Field addition is realized in all bases by a bit-wise exclusive OR (XOR) operation, whereas the structure of field multiplication is determined by the choice of basis for the representation.
There are several representations of extension fields GF(2.sup.n) that lend themselves to efficient arithmetic implementation over the binary field GF(2).
Two families of bases are commonly used to represent the field GF(2.sup.n): standard (or polynomial) representation and normal basis (NB) representation. For certain values of n, a special case of the letter is called optimal normal basis (ONB).
In standard polynomial representation, the basis elements have the form 1,.omega.,.omega..sup.2, . . . , .omega..sup.n-1, . . . , where .omega. is a root in GF(2.sup.n) of an irreducible polynomial P(x) of degree n over GF(2). In an equivalent interpretation of this representation, the elements of GF(2.sup.n) are polynomials of degree at most n-1 over GF(2), and arithmetic is carried out modulo an irreducible polynomial P(x) of degree n over GF(2).
In ONB representation, the basis elements have the form (.alpha.,.alpha..sup.2, . . . , .alpha..sup.2.sup..sup.n-1 ) for a certain element .alpha..epsilon. GF(2.sup.n). This defines a normal basis. In addition, if for all 0.ltoreq.i.noteq.j.ltoreq.n-1 there exists k, l such that, EQU .alpha..sup.(2'+2') =.alpha..sup.2' +.alpha..sup.2',
then the basis is called optimal. The element .alpha. is called the generator of the basis. Optimal normal bases exist for an infinite subset of values of n defined later on.
When the polynomial P(x) is sparse, the standard representation lends itself to efficient software implementations of the field arithmetic. In the software execution context, there are efficient implementations for polynomial multiplication and inversion. On the other hand, the ONB representation typically allows for more efficient hardware implementations of field multiplication. See Ch. 5 of Menezes et al, Applications of Finite Fields, Kluwer, Boston, 1993 and Omura and Massey (U.S. Pat. No. 4,587,627). Inversion, however, remains a difficult operation in the hardware execution context. Addition is typically easy to accomplish in either execution context.
Large finite fields are the basis of many modem cryptographic algorithms, e.g. elliptic curve cryptography. In these applications, n is typically on the order of 100 which, using some conventional algorithms, can require thousands of operations in order to perform a computation. The field arithmetic therefore becomes a computational bottleneck and use of the most efficient implementations available is important to reducing the overhead required to perform cryptographic operations. On the other hand, the explosive development of the Internet is expected to make the use of encryption become widespread, and will require hardware and software implementations to interoperate and use common representations.
Accordingly, the need remains for a method for making use of efficient algorithms to perform arithmetic operations in large finite fields.